import React from 'react';
import { inject, observer } from 'mobx-react';
import { Button } from "antd";
import { toJS } from 'mobx';
import { WeaLocaleProvider, WeaDialog, WeaTableEdit, WeaTab } from 'ecCom';
import { WeaTableNew } from "comsMobx";
import { Condition, CardCondition } from '../list/listCondition';
import { Text } from '../util/text';
const text = new Text();
const WeaTable = WeaTableNew.WeaTable;
const getLabel = WeaLocaleProvider.getLabel;

@observer
class RewardListDialog extends React.Component {

    //历史加分记录弹出框
    componentDidMount() {

    }

    addScore = () => {
        const { store } = this.props;
        store.parent.rewardDialogStore.setState({ visible: true });
    }

    render() {
        const { store, store: { status, setState, tableStore } } = this.props;
        const { visible } = status;
        let btns = new Array();
        btns.push(<Button onClick={() => { this.addScore() }} type="primary" shape="circle" icon="plus" size="small" ></Button>);
        btns.push(<Button onClick={() => { this.delScore() }} shape="circle" icon="minus" size="small"></Button>);
        return (
            <div>
                <WeaDialog
                    icon="icon-coms-government"
                    iconBgcolor='#f14a2d'
                    title={text.HISTORYSCORE}
                    visible={visible}
                    style={{ width: 550, height: 450 }}
                    hasScroll={true}
                    onCancel={() => { setState({ visible: false }) }}
                    buttons={[
                        (<Button type="ghost" onClick={() => { setState({ visible: false }) }}>{text.CLOSE}</Button>)
                    ]}
                >
                    <WeaTab buttons={btns} />
                    <WeaTable comsWeaTableStore={tableStore}
                        className="wea-info-table"
                        needScroll={true}
                    />
                </WeaDialog>
            </div>
        )
    }

}

export { RewardListDialog };